package com.lanxincn.touye.external.struct;

/**
 * @Author: huoming
 * @Description: 循环节点
 */
public class Node {

    /**
     * 循环节点id
     * */
    private Integer id;

    /**
     * 循环节点名称
     * */
    private String name;

    /**
     * 下一个循环节点
     * */
    private Node next;

    public Node(){}

    public Node(Integer id) {
        this.id = id;
    }

    public Node(Integer id,String name) {
        this.id = id;
        this.name = name;
    }

    public Node getNext(){
        if (this.next==null)return this;
        else return this.next;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setNext(Node next) {
        this.next = next;
    }

    @Override
    public boolean equals(Object obj) {
        return ((Node) obj).getId().equals(this.id);
    }
}
